#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <limits.h>

static void *thread_start(void* arg)
{
    int i,res;
    size_t stack_size;
    pthread_attr_t gattr;

    res = pthread_getattr_np(pthread_self(),&gattr);

    res=pthread_attr_getstacksize(&gattr,&stack_size);

    printf("default size %u;minimum %u \n",stack_size,PTHREAD_STACK_MIN);

    pthread_attr_destroy(&gattr);

}

int main()
{
    pthread_t tid;
    int s;

    pthread_create(&tid,NULL,&thread_start,NULL);

    pthread_join(tid,NULL);

}